#include <iostream>
#include <vector>

using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::string;

int main()
{
	vector<int> iv;
	int it;
	while(cin >> it)
	{
		iv.push_back(it);
	}

	vector<int>::size_type st = iv.size();

	if(st % 2 != 0)
	{ 
		if(st >0)
		{
			cout << iv[st - 1];
		}
		cout << " Not matched!" << endl;

		return 0;
	}

	for(vector<int>::const_iterator itr = iv.begin(); itr != iv.end(); )
	{
		cout << *itr + *(++itr) << " ";
		++itr;
	}
	cout << endl;
	vector<int>::const_iterator itr_bg = iv.begin();
	vector<int>::const_iterator itr_ed = iv.end();
	itr_ed--;	
	while(itr_bg < itr_ed) 
	{
		cout << *itr_bg + *itr_ed << " ";
		itr_bg++;
		itr_ed--;
	}
	cout << endl;

	return 0;
}
